! 包含其他目录下的目标
! $ cd sub
! $ gfortran -c functions.f90
! $ cd main
! $ gfortran -c tabulate.f90 -I ../sub
! $ gfortran -o tabulate tabulate.o ../sub/functions.o
! ----------------------------------------------------------
! 创建静态库并使用
! ar rcs libuser_functions.a .\functions.o
! gfortran.exe -o myprogram .\tabulate.f90 -L ../sub -luser_functions
program tabulate
    use user_functions

    implicit none
    real    :: x, xbegin, xend
    integer :: i, steps

    write(*,*) 'Please enter the range (begin, end) and the number of steps:'
    read(*,*)  xbegin, xend, steps

    do i = 0, steps
        x = xbegin + i * (xend - xbegin) / steps
        write(*,'(2f10.4)') x, f(x)
    end do
end program tabulate